<template>
    <div>
        <ul>
            <li v-for="(value,index) in list" :key="index" @click="setName(value,$event)">
                {{value}}
            </li>
        </ul>
        <h1>{{name}}</h1>
    </div>
</template>
<script>
export default {
    data(){
        return {
            list:['蓝莓','草莓','西柚'],
            name:'',
        }
    },
    methods:{
        setName(name,event){
            //console.log(event.target.innerText)
            this.name = name;
            console.log(event)
        }
    }
}
</script>